package com.aipartner.dto;

import lombok.Data;
import java.util.List;

/**
 * AI图片生成响应DTO
 * 
 * @author AI Partner Team
 * @since 2024-01-20
 */
@Data
public class AiImageResponse {
    
    /**
     * 生成的图片URL（主图片）
     */
    private String imageUrl;
    
    /**
     * 生成的多张图片URL列表
     */
    private List<String> imageUrls;
    
    /**
     * 任务ID
     */
    private String taskId;
    
    /**
     * 原始提示词
     */
    private String prompt;
    
    /**
     * 图片尺寸
     */
    private String size;
    
    /**
     * 图片风格
     */
    private String style;
    
    /**
     * 状态：0-处理中，1-成功，2-失败
     */
    private Integer status;
    
    /**
     * 状态字符串：processing, completed, failed
     */
    private String statusString;
    
    /**
     * 状态描述
     */
    private String statusMessage;
    
    /**
     * 创建成功的响应
     */
    public static AiImageResponse success(String imageUrl, String taskId, String prompt, String size, String style) {
        AiImageResponse response = new AiImageResponse();
        response.setImageUrl(imageUrl);
        response.setTaskId(taskId);
        response.setPrompt(prompt);
        response.setSize(size);
        response.setStyle(style);
        response.setStatus(1);
        response.setStatusString("completed");
        response.setStatusMessage("生成成功");
        return response;
    }
    
    /**
     * 创建处理中的响应
     */
    public static AiImageResponse processing(String taskId, String prompt, String size, String style) {
        AiImageResponse response = new AiImageResponse();
        response.setTaskId(taskId);
        response.setPrompt(prompt);
        response.setSize(size);
        response.setStyle(style);
        response.setStatus(0);
        response.setStatusString("processing");
        response.setStatusMessage("正在生成中...");
        return response;
    }
    
    /**
     * 创建失败的响应
     */
    public static AiImageResponse failed(String taskId, String prompt, String errorMessage) {
        AiImageResponse response = new AiImageResponse();
        response.setTaskId(taskId);
        response.setPrompt(prompt);
        response.setStatus(2);
        response.setStatusString("failed");
        response.setStatusMessage(errorMessage);
        return response;
    }
}
